<?php
import('ORG.Util.Page');
class PageEx extends Page{
    public function show($isArray=false){
        if(0 == $this->totalRows) return;
        $nowCoolPage      = ceil($this->nowPage/$this->rollPage);
        $url  =  $_SERVER['REQUEST_URI'].(strpos($_SERVER['REQUEST_URI'],'?')?'':"?").$this->parameter;
        $select='';
        $iterate=$this->totalPages;
        while($iterate){
            if($iterate!=$this->nowPage){
                $select='<option value="'.$iterate.'">'.$iterate.'</option>'.$select;
            }
            $iterate--;
        }
        $pageEx='&'.C('VAR_PAGE').'=';
        //$pageStr='<label>共'.$this->totalRows.$this->config['header'].'/'.$this->totalPages.'页,当前第'.$this->nowPage.'页</label>';
        $pageStr = sprintf(L('page'),$this->totalPages,$this->nowPage);
        if($select){
            $pageStr.='<script type="text/javascript">function gotoPage(p){if'.
                      '(p==0)return;else window.location="'.$url.$pageEx.
                      '"+p;}</script>,'.L('page_jumpto').
                      '&nbsp;<select onchange="gotoPage(this.options'.
                      '[this.selectedIndex].value)"><option value="0">'.
                      L('page_pls_select').'</option>'.$select.'</select>';
        }
        return $pageStr;
    }
}